package org.car.world.service.impl;

import java.util.List;

import org.car.world.core.entily.CommentsTable;
import org.car.world.core.mapper.CommentsTableMapper;
import org.car.world.service.CommentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;


@Service
@Transactional(rollbackFor = {RuntimeException.class, Exception.class})
public class CommentsServiceImpl implements CommentsService {

    @Autowired
    CommentsTableMapper commentsTableMapper;

    @Override
    public int deleteByPrimaryKey(Integer commentsId) {
        return commentsTableMapper.deleteByPrimaryKey(commentsId);
    }

    @Override
    public int insert(CommentsTable record) {
        return commentsTableMapper.insert(record);
    }

    @Override
    public CommentsTable selectByPrimaryKey(Integer commentsId) {
        return commentsTableMapper.selectByPrimaryKey(commentsId);
    }


    @Override
    public List<CommentsTable> selectAll() {
        return commentsTableMapper.selectAll();
    }

    @Override
    public int updateByPrimaryKey(CommentsTable record) {
        return commentsTableMapper.updateByPrimaryKey(record);
    }


    @Override
    public int selectAllPlNum(Integer merchantsId) {
        return commentsTableMapper.selectAllPlNum(merchantsId);
    }

    @Override
    public List<CommentsTable> selectAllMerid(Integer merchantsId) {
        return commentsTableMapper.selectAllMerid(merchantsId);
    }


    @Override
    public List<CommentsTable> selectAllMeridLimit(Integer merchantsId, Integer form, Integer size) {
        PageHelper.startPage(form, size);
        return commentsTableMapper.selectAllMerid(merchantsId);
    }

}
